#!/usr/bin/env python3
"""
Debug script to check working directory and path issues
"""
import os
import sys
from pathlib import Path

def debug_paths():
    print("=== Debugging Paths ===")
    print(f"Current working directory: {os.getcwd()}")
    print(f"__file__: {__file__}")
    print(f"sys.path[0]: {sys.path[0]}")
    
    # Check where DataPersistence looks for files
    data_dir = Path("data")
    print(f"data_dir (relative): {data_dir}")
    print(f"data_dir absolute: {data_dir.absolute()}")
    print(f"data_dir exists: {data_dir.exists()}")
    
    # Check the actual data directory
    actual_data = Path(__file__).parent / "data"
    print(f"actual_data: {actual_data}")
    print(f"actual_data exists: {actual_data.exists()}")
    
    # Check files in both directories
    if data_dir.exists():
        print(f"Files in relative data: {list(data_dir.glob('*.json'))}")
    if actual_data.exists():
        print(f"Files in actual data: {list(actual_data.glob('*.json'))}")

if __name__ == "__main__":
    debug_paths()